package model

import (
	"gopkg.in/mgo.v2/bson"
	"time"
)

// PlayerDoc
// @Description: 玩家
type PlayerDoc struct {
	Id          bson.ObjectId `json:"Id" bson:"_id,omitempty"`
	UserId      string        `bson:"UserId"`
	Name        string        `bson:"Name"`
	Gender      int           `bson:"Gender"`
	Head        int           `bson:"Head"`        //头像Id
	TimeCreate  time.Time     `bson:"TimeCreate"`  //创建时间
	TimeLogin   time.Time     `bson:"TimeLogin"`   //上次登录时间
	TimeOffline time.Time     `bson:"TimeOffline"` //上次离线时间

	Moneys map[string]int64 `bson:"Moneys"` //货币列表

	FlagInt      map[string]int32 `bson:"FlagInt"`      //客户端标记
	FlagDailyInt map[string]int32 `bson:"FlagDailyInt"` //客户端标记日更新

	MailIds           []string `bson:"MailIds"`           //邮件列表ID
	GlobalMailVersion int      `bson:"GlobalMailVersion"` //全服邮件版本号

	TimeVitalityRecovery time.Time `bson:"TimeVitalityRecovery"` //上次体力恢复时间

	Items map[string]int64 `bson:"Items"` //道具列表

	EquipIds []string `bson:"EquipIds"` //装备列表ID
}

var PlayerCollectionName = "player"

func (player *PlayerDoc) CollectionName() string {
	return PlayerCollectionName
}
func (player *PlayerDoc) Id_() interface{} {
	return player.Id
}
func (player *PlayerDoc) IdString() string {
	return player.Id.Hex()
}
